package cn.cloud9;

public class Demo2CompareThreeMonkHeight {

    /**
     * https://www.bilibili.com/video/BV18J411W7cE?p=28
     * 比较三个和尚的身高
     * @param args
     */
    public static void main(String[] args) {
        final int MONK_1_HEIGHT = 165;
        final int MONK_2_HEIGHT = 196;
        final int MONK_3_HEIGHT = 185;

        /**
         * 或者使用随机数
         * final Random RANDOM = new Random();
         * final int MONK_1_HEIGHT = RANDOM.nextInt(100) + 1 + 100;
         * final int MONK_2_HEIGHT = RANDOM.nextInt(100) + 1 + 100;
         * final int MONK_3_HEIGHT = RANDOM.nextInt(100) + 1 + 100;
         */
        int maxMonkHeight = MONK_1_HEIGHT > MONK_2_HEIGHT ? MONK_1_HEIGHT : MONK_2_HEIGHT;
        maxMonkHeight = maxMonkHeight > MONK_3_HEIGHT ? maxMonkHeight : MONK_3_HEIGHT;
        System.out.println("最高值：" + maxMonkHeight);
    }
}
